package com.t114514.demo.mapper;

import com.t114514.demo.pojo.Teacher;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TeacherMapper {
    @Select("select * from teacher where teacherAccount = #{teacherAccount}")
    Teacher selectTeacher(String teacherAccount);

    @Insert("insert into teacher(teacherAccount, teacherPassword,teacherName) values(#{teacherAccount}, #{password},#{teacherName})")
    void insertTeacher(String teacherAccount, String password,String teacherName);

    @Update("update teacher set teacherPassword = #{teacherPassword},teacherName=#{teacherName} where teacherAccount = #{teacherAccount}")
    void updateTeacher(Teacher teacher);

    @Select("select * from teacher where teacherId = #{teacherId}")
    Teacher selectByTeacherId(int teacherId);
}
